﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class admindenglu : System.Web.UI.Page
{
    string conn = "Data Source=RunSky;Initial Catalog=info;Integrated Security=True";
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConnection sqlcon = new SqlConnection(conn);
        sqlcon.Open();
        string check_admin = "select * from [T_user] where username = '" + TextBoxName.Text + "'and usercode ='" + TextBoxPassWord.Text + "'";
        SqlCommand com = new SqlCommand(check_admin, sqlcon);
        if (com.ExecuteScalar() == null)
            Response.Write("<script>alert('用户名或者密码错误！')</script>");
        else
            Response.Redirect("guanliuser.aspx");
    }
}
